package com.example.demo.LeetCode.arr;

public class FindPeakElement {
  public  boolean solution(int[] nums){
    int size = nums.length;
    int left = 0,right = size -1;
    while (left <= right){
      int mid = (right - left) /2 + left;
      int val = nums[mid];
      int leftVal = nums[mid -1];
      int rightVal = nums[mid +1];
      if (leftVal < val && rightVal < val){
         return  true;
      }

    }
    return false;
  }
}

